<template>
	<div class="item_show_container" @click="gotoItem(item.id)">
		<div class="image_container">
			<my-image type="items" :icon="item.iconUrl" :size="41"></my-image>
			<p class="number">{{ item.amount }}</p>
		</div>
		<div class="text_container">
			<div class="name">{{ item.name }}</div>
			<div class="rate">{{ 60 * item.amount / time }} item/min</div>
		</div>
	</div>
</template>

<script>
	import MyImage from "@/components/Image.vue";
	export default {
		name: "ItemRateShow",
		props: ["item", "time"],
		components: {
			MyImage
		},
		methods: {
			gotoItem(id) {
				this.$router.push({
					path: "/item/info",
					query: {
						id
					}
				})
			},
		},
	};
</script>

<style lang="less" scoped>
	.item_show_container {
		background-color: rgba(0, 0, 0, 0.6);
		border: 1px solid black;
		border-radius: 4px;
		padding: 4px;
		display: flex;
		gap: 4px;
		justify-content: space-between;
		align-items: center;
		margin: 5px;
		min-width: 100px;
		float: left;
		color: rgb(255, 255, 255);

		.image_container {
			position: relative;
			width: 40px;
			margin-bottom: -16px;

			.number {
				position: relative;
				float: right;
				height: 16px;
				line-height: 16px;
				margin: 0;
				z-index: 10;
				top: -16px;
			}

			.image {
				position: relative;
				border-radius: 2px;
				float: left;
				width: 40px;
				height: 40px;
			}
		}
		
		.text_container{
			.name{
				
			}
			.rate{
				font-size: 10px;
			}
		}

	}
</style>